<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>问卷调查配置表</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script src="plug-in/lodash/lodash.min.js"></script>	
  <script type="text/javascript">
  //编写自定义JS代码
  var index = 0;
  var selectIndex = 0;
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="questionConfigController.do?doAdd" >
		<input id="id" name="id" type="hidden" value="${questionConfigPage.id }"/>
		<input id="createName" name="createName" type="hidden" value="${questionConfigPage.createName }"/>
		<input id="createBy" name="createBy" type="hidden" value="${questionConfigPage.createBy }"/>
		<input id="createDate" name="createDate" type="hidden" value="${questionConfigPage.createDate }"/>
		<input id="updateName" name="updateName" type="hidden" value="${questionConfigPage.updateName }"/>
		<input id="updateBy" name="updateBy" type="hidden" value="${questionConfigPage.updateBy }"/>
		<input id="updateDate" name="updateDate" type="hidden" value="${questionConfigPage.updateDate }"/>
		<input id="sysOrgCode" name="sysOrgCode" type="hidden" value="${questionConfigPage.sysOrgCode }"/>
		<input id="sysCompanyCode" name="sysCompanyCode" type="hidden" value="${questionConfigPage.sysCompanyCode }"/>
		<input id="bpmStatus" name="bpmStatus" type="hidden" value="${questionConfigPage.bpmStatus }"/>
		<!-- <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable"> -->
				<tr>
					<td align="right">
						<label class="Validform_label">
							标题:
						</label>
					</td>
					<td class="value">
					     	 <input id="bpmTitle" name="bpmTitle" type="text" style="width: 150px" class="inputxt" 
					     	  
					     	  ignore="ignore"
					     	  />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">标题</label>
						</td>
						<td align="right">
						<label class="Validform_label">
							问卷表名:
						</label>
					</td>
					<td class="value">
					     	 <input id="by3" name="by3" type="text" style="width: 150px" class="inputxt" validtype="question_config,by_3,id" datatype="s1-30,/^[a-z\d_]+$/"  errormsg="只允许英文小写字母"
					     	  ignore="ignore"
					     	  />
							<span class="Validform_checktip"> </span>
							<label class="Validform_label" style="display: none;">问卷表名</label>
						</td>
				</tr>
				
			<div>
			  <div id="addq" onclick="javascript:addQue()"><a style="background-color: #00cc99;border-width:4px;border-style:outset"">添加问题</a></div>
		      </div>
		    <div id="que-div"  >
			
		</div>
				
				<!-- <tr>
					<td align="right">
						<label class="Validform_label">
							问题添加:
						</label>
					</td>
					<td class="value">
					     	 <input id="bpmQuestion" name="bpmQuestion"  
					     	  type="hidden"
					     	  ignore="ignore"
					     	  />
					     	  <input type="button" value="添加问题" id="addQuest" name="addQuest" onclick="openAddQuestions()"  />
						</td>
				</tr> -->
		<!--  追加问题行 -->
		<%-- <tbody id="add_jformEmployeeMealsCost_table">
	    <c:if test="">
	    </c:if>
	    <tbody id="add_selects_table">
	    <c:if test="">
	    </c:if>
	    </tbody>
	    </tbody>
			</table> --%>
		</t:formvalid>
		<div onclick="javascript:commitDate()"><a style="background-color: #00cc99;border-width:4px;border-style:outset;font-size:15px;text-align:center">提交</a></div>
		      </div>
		</body>
		
		
		
		<!--  添加问题模板  单选和多选  -->
		<!-- <table style="display:none">
		<tbody id="addQuestion_div">
		<tr>
		<td align="right">
		<label class="Validform_label">
							问题
						</label>
		</td>
		<td align="left">
		<label class="Validform_label" name="xh">
		</label>
		</td>
		</tr>
		<tr>
			<td align="right">
						<label class="Validform_label">
							问题描述:
						</label>
					</td>
					<td class="value">
					     	 <input id="questionList[#index#].questionRe" name="questionList[#index#].questionRe" type="text" style="width: 150px" class="inputxt" 
					     	  
					     	  ignore="ignore"
					     	  />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">问题描述</label>
						</td>
				</tr>
		     <tr>
					<td align="right">
						<label class="Validform_label">
							问题类型:
						</label>
					</td>
					<td class="value">
					     	 <select id="questionList[#index#].questionType"  name="questionList[#index#].questionType">
					     	  <option value="volvo">单选</option>
                              <option value="saab">多选</option>
					     	 </select>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">问题类型</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							问题选项添加:
						</label>
					</td>
					<td class="value">
					     	<input   type="button" id="selects" name="selects" onclick="openAddSelects()" value="问题选项添加"/>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">问题选项添加</label>
						</td>
				</tr>
		 选项模板 
		
		<tbody id="addSelects_div">
		
		<tr>
					<td align="right">
						<label class="Validform_label">
							选项描述:
						</label>
					</td>
					<td class="value">
					     	 <input id="selectionList[#index#][#selectIndex#].selectRe" name="selectionList[#index#][#selectIndex#].selectRe" type="text" style="width: 150px" class="inputxt" 
					     	  ignore="ignore"
					     	  />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">选项描述</label>
						</td>
				</tr>
		</tbody>
		
		</tbody>
	</table> -->
	
	
	<script id="expPanelTemp" type="text/template">
<div class="que" style="background-color:#96CDCD;border-color:#000000;border-width:2px;border-style:outset">
	<div class="no"> <a style="font-size:20px;color:yellow">问题<@=data.no@></a></div>
	<div class="questionRe"><li><a style="font-color:red;" >
	问题描述:</a></li></div>
	<div class="questionAs"><input type="text" name="qu" value="<@=data.que@>"</div>
	<div class="questionTypeDiv"><li><a style="font-color:red;" >问题类型:</a></li></div>
    <div id="type">  <select id="questionType"  name="questionType">
					     	  <option value="0">单选</option>
                              <option value="1">多选</option>
					     </select> 
    </div>
	<div class="addOpt"><a style="background-color: #00cc99;border-width:4px;border-style:outset"">添加选项</a></div>
	<div class="opt-div"></div>
</div>
</script>		

<script id="optTemp" type="text/template">
<div class="opt" style="background-color: #C0C0C0;">
  <div class="no"> <a  style="font-size:15px;color:red">选项<@=data.no@></a></div>
  <div ><li><a style="font-color:red;" >选项描述:</a></li></div>
  <div class="selectRe"><input type="text"  name="qo" value="<@=data.que@>"</div>
  <div><li><a style="font-color:red;" >是否正确答案:</a></li></div>
  <div class="as">  <select id="questionAs"  name="questionAs">
					     	  <option value="0">正确</option>
                              <option value="1">错误</option>
                              <option value="2">无标准答案</option>
					     </select> 
                  </div>
</div>
</script>		
	
  <script src = "webpage/lv/questionConfig.js"></script>		
